<?php

namespace Yolo\Components\RpcClient;

use Psr\Http\Message\ResponseInterface;

interface ClientInterface
{
    public function getServiceName(): string;

    /**
     * Invoke an internal rpc api
     * @param string $endpoint
     * @param array $data
     * @return mixed
     */
    public function invoke(string $endpoint, array $data): ResponseInterface;

    /**
     * Invoke a rpc api by namespace
     * @param string $ns
     * @param string $endpoint
     * @param array $data
     * @return mixed
     */
    public function invokeByNs(string $ns, string $endpoint, array $data): ResponseInterface;
}
